package com.gm.wholesale.module.kind.api;

import android.util.ArrayMap;

import com.gm.commonlib.base.baseBean.BaseListResp;
import com.gm.commonlib.base.baseBean.BaseResp;
import com.gm.commonlib.base.baseBean.DataResp;
import com.gm.wholesale.module.kind.bean.KindBean;


import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface IKindApi {
    //获取分类列表
    @GET("pda/api/v1/category")
    Observable<BaseListResp<KindBean>> getCategory();


    //修改分类
    @PUT("pda/api/v1/category/{id}")
    Observable<BaseResp> updateCategory(@Path ("id") long id,@Body ArrayMap<String,Object> data);


    //创建分类
    @POST("pda/api/v1/category")
    Observable<DataResp<Long>> createKind(@Body ArrayMap<String,Object> data);


    //删除分类
    @DELETE("pda/api/v1/category/{id}")
    Observable<BaseResp> deleteKind(@Path ("id") long id, @Query("version") int version);
}
